package com.li.springbootproject.service.test.impl;

import com.li.springbootproject.service.test.ServiceA;
import com.li.springbootproject.service.test.ServiceB;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 7/8/2022 3:16 PM
 */
@Service
public class ServiceAImpl implements ServiceA {

    private static final Logger logger = LoggerFactory.getLogger(ServiceAImpl.class);

    @Autowired
    @Lazy
    private ServiceB serviceB;

    // @Autowired
    // public void setServiceB(ServiceB serviceB) {
    //     this.serviceB = serviceB;
    // }

    public void test1() {
        serviceB.test1();
    }

    @Override
    public void test2() {
        logger.info("ServiceA test2()");
    }
}
